<?xml version="1.0" encoding="UTF-8" ?>

<!-- 
One XLST that use HTML + CSS to display a table with all the stadiums showing 
for each stadium the number of games which took place there with the total 
number of spectators.
-->

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output method="html" indent="yes"/>

	<xsl:template match="/">
		<html>
				<head>
					<title>XpertStats XML - Tabela Classificativa</title>
					<link href="css/bluedream.css" media="screen" rel="stylesheet" type="text/css" />
					<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
					<link rel="shortcut icon" href="images/logo.ico" />
					<link rel="icon" type="image/gif" href="images/logo.ico" />
				</head>
				<body>
					<div id="wrapper">
						<div id="header">
							<div id="header_content">
								<img src="./images/logo.png"/>
								<div style="float:right">
								   
								</div>
							</div>
						</div>  
						<div id="menuStrip">
							<ul class="menu">
								  <li><a href="stadiums_data.xml" class="active"><span>Stadiums</span></a></li>
								  <li><a href="teams_data.xml"><span>Teams</span></a></li>
								  <li><a href="players_data.xml"><span>Players</span></a></li>
								  <li><a href="fixtures_data.xml"><span>Fixtures</span></a></li>
							</ul>    
						</div>
			
					   <div id="main" style="padding-top: 10px;">   
							<table border="1" width="100%" class="geral">
									<thead>
										<tr>
											<th>Stadium</th>
											<th style="text-align:center">Games Host</th>
											<th style="text-align:center">Spectators</th>
											<th style="text-align:center">Average Spectators</th>
										</tr>
									</thead>
									<tbody>
      
      
      <xsl:for-each select="/stadiums/stadium">
      <xsl:variable name="currentStadium" select="@id"></xsl:variable>
											<tr>
											  <td><xsl:value-of select="name"/></td>
											  <td style="text-align:center"><xsl:value-of select="gamesHeld"/></td>
											  <td style="text-align:right; padding-right:30px;">
											  <xsl:value-of select="totalSpectators" /></td>
											  <td style="text-align:right; padding-right:30px;"><xsl:value-of select="averageSpectators" /></td>
											</tr>
      </xsl:for-each>
	
									</tbody>
							</table>	
					</div>
				</div>
				<div id="footer">
					<div id="footerD">
						<div id="footerF" class="aligned">XpertStats XML - CTXML 2011 @ FCT-UNL</div>
						<div id="footerS" class="aligned">By: Ricardo Mestre &amp; Nuno Gomes</div>
					</div>
				</div>    
			</body>
		</html>
	</xsl:template>

</xsl:stylesheet>

